
    var HttpRequestFactory=
    {
        /**
         * Create a new XMLHttpRequest.
         * @return {XMLHttpRequest}
         * @throws {Error} If the environment does not support XMLHttpRequest.
         * @throws {Error} If environment is a legacy IE browser that does not
         *                 support the MSXML2.XMLHTTP.3.0 ActiveX module.
         *                 
         * @see HttpRequestFactory#isViable
         */
        newHttpRequest: new function () 
        {
            if (window.XMLHttpRequest) return function () 
            {
                return new XMLHttpRequest;
            };
            
            if (window.ActiveXObject) return function () 
            {
                return new ActiveXObject('MSXML2.XMLHTTP.3.0');
            };
            
            return function () 
            {
                throw new Error('XMLHttpRequest is not supported.');
            };
        }
        
        /**
         * Determine if the factory is viable, that is, that it can create
         * XMLHttpRequest objects.
         * @return {Boolean}
         * @see HttpRequestFactory#newHttpRequest
         */
    ,   isViable: function () 
        {
            if (null != this.viable)
                return this.viable;
            
            try 
            {
                this.newHttpRequest()
                this.viable= true;
            }
            catch (thrown) 
            {
                this.viable= false;
            }    
        }
    };
